/**
 * GroupListService.java
 * Version 1.0.0
 * Created on 2019年1月16日
 */
package com.yincheng.oes.business.group.service;

import com.yincheng.oes.business.group.mapper.GroupListMapper;
import com.yincheng.oes.business.group.model.query.QueryParamBean;
import com.yincheng.oes.business.group.model.result.QueryResultRowBean;
import com.yincheng.oes.business.util.Page;
import java.util.List;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author yangsy
 * @version 1.0.0
 * @since
 * 创建时间：2019年1月16日
 * <p>
 * 功能描述：
 * <p>
 * 邮箱地址：446948434@qq.com
 */
@Service
public class GroupListService {

    @Autowired
    private GroupListMapper groupListMapper;

    public Pair<Integer, List<QueryResultRowBean>> getListByParam(QueryParamBean param) {
        Page page = param.getPage();
        int total = groupListMapper.countByParam(param);
        page.setTotal(total);
        List<QueryResultRowBean> list = groupListMapper.selectByParam(param);
        return Pair.of(total, list);
    }
}
